<template>
	<u-modal :show="show" duration="200" :showConfirmButton="false" :showCancelButton="false" width="600rpx" class="models">
		<view class="content">
			<view class="head">{{title}}</view>
			<slot name="custom"></slot>
			<scroll-view scroll-y="true" v-if="content">
				<view class="cont">
					{{content}}
				</view>
			</scroll-view>
			<view class="btn-rows">
				<view hover-class="hover_class" class="calcel" v-if="cancel" @click="cancels">取消</view>
				<view hover-class="hover_class" class="btn" @click="save" v-if="showBtn">确定</view>
			</view>
		</view>
	</u-modal>
</template>

<script>
	export default{
		data() {
			return {
				show: false
			}
		},
		props:{
			title:{
				type:String,
				default:'提示'
			},
			content:{
				type:String,
				default:""
			},
			showBtn:{
				type:Boolean,
				default:true
			},
			cancel: {
				type: Boolean,
				default: true
			}
		},
		methods:{
			open(){
				this.show = true
			},
			cancels() {
				this.show = false
				this.$emit('cancels')
			},
			save(){
				this.show = false
				this.$emit('save')
			}
		}
	}
</script>

<style scoped lang="scss">
.btn-rows {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	>view {
		width: 48%;
		height: 80upx;
		display: flex;
		align-items: center;
		justify-content: center;
		font-weight: 500;
		border-radius: 40upx;
		font-size: 30upx;
	}
	.calcel {
		border: 1px solid #023F92;
		color: #023F92;
	}
	.btn{
		background: #023F92;
		color: #ffffff;
	}
}
.content{
	background-color: #fff;
	width: 600upx;
	border-radius: 10upx;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
	.head{
		text-align: center;
		font-size: 36upx;
		color: #333333;
		margin-bottom: 57upx;
		font-weight: bold;
	}
	.cont{
		font-size: 30upx;
		color: #666666;
		margin-bottom: 80upx;
		line-height: 40upx;
		text-align: center;
		max-height: 400upx;
	}
}
</style>
